home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
util
/
simulare.sit
/
Simula 4.07 Reference
/
card_34303.txt
< prev
next >
Wrap
Text File
|
1989-05-02
|
2KB
|
84 lines
-- card: 34303 from stack: in.07 Reference
-- bmap block id: 0
-- flags: 0000
-- background id: 13647
-- name:
-- part 1 (field)
-- low flags: 00
-- high flags: 0002
-- rect: left=289 top=54 right=261 bottom=474
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name:
-- part 2 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=97 top=288 right=310 bottom=144
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: inner
----- HyperTalk script -----
on mouseUp
go to card id 2130
end mouseUp
-- part contents for background part 1
----- text -----
An instance of a class is called an object.
Objects can be created dynamically and
are removed by the garbage collector
when no longer accessible.
Objects are created with the "new" constructor.
The parameters of all the prefix classes must
be supplied in order, starting with parameters
of the outermost prefix class.
In the default case the bodies of all the classes
are executed in order, also starting with the
outermost prefix class, but this can be
changed with the "inner" mechanism.
-- part contents for background part 2
----- text -----
Object creation
-- part contents for card part 1
----- text -----
class Car(YearMade);
Integer YearMade;
begin
text Plate;
Plate:-Register(this Car);
end --- Car ---;
Car class Lorry(MaxLoad);
Integer MaxLoad;
begin
RegisterTIR(this Car,Plate);
end --- Lorry ---;
new Lorry(1989,1200);
! -- the lorry executes:
Register first, then RegisterTIR -- ;